<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<title>Writing Service Methods - The Java EE 5 Tutorial</title>
<meta name="robots" content="index,follow">
<meta name="robots" content="index,follow">
<meta name="date" content="2008-10-01">
<link rel="stylesheet" type="text/css" href="css/default.css">
<link rel="stylesheet" type="text/css" href="css/ipg.css">
<link rel="stylesheet" type="text/css" href="css/j5eetutorial.css">
</head>

<body>

<table border="0" cellpadding="5" cellspacing="0" width="100%">
<tbody>
   <tr valign="top">
      <td><p class="toc level1"><a href="docinfo.html">Document Information</a></p>
<p class="toc level1 tocsp"><a href="gexaf.html">Preface</a></p>
<p class="toc level1 tocsp"><a href="gfirp.html">Part&nbsp;I&nbsp;Introduction</a></p>
<p class="toc level2"><a href="bnaaw.html">1.&nbsp;&nbsp;Overview</a></p>
<p class="toc level2"><a href="gfiud.html">2.&nbsp;&nbsp;Using the Tutorial Examples</a></p>
<p class="toc level1 tocsp"><a href="bnadp.html">Part&nbsp;II&nbsp;The Web Tier</a></p>
<p class="toc level2"><a href="bnadr.html">3.&nbsp;&nbsp;Getting Started with Web Applications</a></p>
<p class="toc level2"><a href="bnafd.html">4.&nbsp;&nbsp;Java Servlet Technology</a></p>
<p class="toc level3"><a href="bnafe.html">What Is a Servlet?</a></p>
<p class="toc level3"><a href="bnaff.html">The Example Servlets</a></p>
<p class="toc level4"><a href="bnaff.html#bnafh">Troubleshooting Duke's Bookstore Database Problems</a></p>
<p class="toc level3 tocsp"><a href="bnafi.html">Servlet Life Cycle</a></p>
<p class="toc level4"><a href="bnafi.html#bnafj">Handling Servlet Life-Cycle Events</a></p>
<p class="toc level5"><a href="bnafi.html#bnafk">Defining the Listener Class</a></p>
<p class="toc level5"><a href="bnafi.html#bnafm">Specifying Event Listener Classes</a></p>
<p class="toc level4 tocsp"><a href="bnafi.html#bnafn">Handling Servlet Errors</a></p>
<p class="toc level3 tocsp"><a href="bnafo.html">Sharing Information</a></p>
<p class="toc level4"><a href="bnafo.html#bnafp">Using Scope Objects</a></p>
<p class="toc level4"><a href="bnafo.html#bnafs">Controlling Concurrent Access to Shared Resources</a></p>
<p class="toc level4"><a href="bnafo.html#bnaft">Accessing Databases</a></p>
<p class="toc level3 tocsp"><a href="bnafu.html">Initializing a Servlet</a></p>
<div class="onpage">
<p class="toc level3"><a href="">Writing Service Methods</a></p>
<p class="toc level4"><a href="#bnafw">Getting Information from Requests</a></p>
<p class="toc level4"><a href="#bnafz">Constructing Responses</a></p>
</div>
<p class="toc level3 tocsp"><a href="bnagb.html">Filtering Requests and Responses</a></p>
<p class="toc level4"><a href="bnagb.html#bnagc">Programming Filters</a></p>
<p class="toc level4"><a href="bnagb.html#bnagd">Programming Customized Requests and Responses</a></p>
<p class="toc level4"><a href="bnagb.html#bnagf">Specifying Filter Mappings</a></p>
<p class="toc level3 tocsp"><a href="bnagi.html">Invoking Other Web Resources</a></p>
<p class="toc level4"><a href="bnagi.html#bnagj">Including Other Resources in the Response</a></p>
<p class="toc level4"><a href="bnagi.html#bnagk">Transferring Control to Another Web Component</a></p>
<p class="toc level3 tocsp"><a href="bnagl.html">Accessing the Web Context</a></p>
<p class="toc level3"><a href="bnagm.html">Maintaining Client State</a></p>
<p class="toc level4"><a href="bnagm.html#bnagn">Accessing a Session</a></p>
<p class="toc level4"><a href="bnagm.html#bnago">Associating Objects with a Session</a></p>
<p class="toc level5"><a href="bnagm.html#bnagp">Notifying Objects That Are Associated with a Session</a></p>
<p class="toc level4 tocsp"><a href="bnagm.html#bnagq">Session Management</a></p>
<p class="toc level4"><a href="bnagm.html#bnagr">Session Tracking</a></p>
<p class="toc level3 tocsp"><a href="bnags.html">Finalizing a Servlet</a></p>
<p class="toc level4"><a href="bnags.html#bnagt">Tracking Service Requests</a></p>
<p class="toc level4"><a href="bnags.html#bnagu">Notifying Methods to Shut Down</a></p>
<p class="toc level4"><a href="bnags.html#bnagv">Creating Polite Long-Running Methods</a></p>
<p class="toc level3 tocsp"><a href="bnagw.html">Further Information about Java Servlet Technology</a></p>
<p class="toc level2 tocsp"><a href="bnagx.html">5.&nbsp;&nbsp;JavaServer Pages Technology</a></p>
<p class="toc level2"><a href="bnajo.html">6.&nbsp;&nbsp;JavaServer Pages Documents</a></p>
<p class="toc level2"><a href="bnakc.html">7.&nbsp;&nbsp;JavaServer Pages Standard Tag Library</a></p>
<p class="toc level2"><a href="bnalj.html">8.&nbsp;&nbsp;Custom Tags in JSP Pages</a></p>
<p class="toc level2"><a href="bnaon.html">9.&nbsp;&nbsp;Scripting in JSP Pages</a></p>
<p class="toc level2"><a href="bnaph.html">10.&nbsp;&nbsp;JavaServer Faces Technology</a></p>
<p class="toc level2"><a href="bnaqz.html">11.&nbsp;&nbsp;Using JavaServer Faces Technology in JSP Pages</a></p>
<p class="toc level2"><a href="bnatx.html">12.&nbsp;&nbsp;Developing with JavaServer Faces Technology</a></p>
<p class="toc level2"><a href="bnavg.html">13.&nbsp;&nbsp;Creating Custom UI Components</a></p>
<p class="toc level2"><a href="bnawo.html">14.&nbsp;&nbsp;Configuring JavaServer Faces Applications</a></p>
<p class="toc level2"><a href="bnaxu.html">15.&nbsp;&nbsp;Internationalizing and Localizing Web Applications</a></p>
<p class="toc level1 tocsp"><a href="bnayk.html">Part&nbsp;III&nbsp;Web Services</a></p>
<p class="toc level2"><a href="bnayl.html">16.&nbsp;&nbsp;Building Web Services with JAX-WS</a></p>
<p class="toc level2"><a href="bnazf.html">17.&nbsp;&nbsp;Binding between XML Schema and Java Classes</a></p>
<p class="toc level2"><a href="bnbdv.html">18.&nbsp;&nbsp;Streaming API for XML</a></p>
<p class="toc level2"><a href="bnbhf.html">19.&nbsp;&nbsp;SOAP with Attachments API for Java</a></p>
<p class="toc level1 tocsp"><a href="bnblr.html">Part&nbsp;IV&nbsp;Enterprise Beans</a></p>
<p class="toc level2"><a href="bnbls.html">20.&nbsp;&nbsp;Enterprise Beans</a></p>
<p class="toc level2"><a href="bnbnb.html">21.&nbsp;&nbsp;Getting Started with Enterprise Beans</a></p>
<p class="toc level2"><a href="bnboc.html">22.&nbsp;&nbsp;Session Bean Examples</a></p>
<p class="toc level2"><a href="bnbpk.html">23.&nbsp;&nbsp;A Message-Driven Bean Example</a></p>
<p class="toc level1 tocsp"><a href="bnbpy.html">Part&nbsp;V&nbsp;Persistence</a></p>
<p class="toc level2"><a href="bnbpz.html">24.&nbsp;&nbsp;Introduction to the Java Persistence API</a></p>
<p class="toc level2"><a href="bnbrl.html">25.&nbsp;&nbsp;Persistence in the Web Tier</a></p>
<p class="toc level2"><a href="bnbrs.html">26.&nbsp;&nbsp;Persistence in the EJB Tier</a></p>
<p class="toc level2"><a href="bnbtg.html">27.&nbsp;&nbsp;The Java Persistence Query Language</a></p>
<p class="toc level1 tocsp"><a href="bnbwi.html">Part&nbsp;VI&nbsp;Services</a></p>
<p class="toc level2"><a href="bnbwj.html">28.&nbsp;&nbsp;Introduction to Security in the Java EE Platform</a></p>
<p class="toc level2"><a href="bnbyk.html">29.&nbsp;&nbsp;Securing Java EE Applications</a></p>
<p class="toc level2"><a href="bncas.html">30.&nbsp;&nbsp;Securing Web Applications</a></p>
<p class="toc level2"><a href="bncdq.html">31.&nbsp;&nbsp;The Java Message Service API</a></p>
<p class="toc level2"><a href="bncgv.html">32.&nbsp;&nbsp;Java EE Examples Using the JMS API</a></p>
<p class="toc level2"><a href="bncih.html">33.&nbsp;&nbsp;Transactions</a></p>
<p class="toc level2"><a href="bncjh.html">34.&nbsp;&nbsp;Resource Connections</a></p>
<p class="toc level2"><a href="bncjx.html">35.&nbsp;&nbsp;Connector Architecture</a></p>
<p class="toc level1 tocsp"><a href="bnckn.html">Part&nbsp;VII&nbsp;Case Studies</a></p>
<p class="toc level2"><a href="bncko.html">36.&nbsp;&nbsp;The Coffee Break Application</a></p>
<p class="toc level2"><a href="bnclz.html">37.&nbsp;&nbsp;The Duke's Bank Application</a></p>
<p class="toc level1 tocsp"><a href="gexbq.html">Part&nbsp;VIII&nbsp;Appendixes</a></p>
<p class="toc level2"><a href="bncno.html">A.&nbsp;&nbsp;Java Encoding Schemes</a></p>
<p class="toc level2"><a href="bncnq.html">B.&nbsp;&nbsp;Preparation for Java EE Certification Exams</a></p>
<p class="toc level2"><a href="bncnt.html">C.&nbsp;&nbsp;About the Authors</a></p>
<p class="toc level1 tocsp"><a href="idx-1.html">Index</a></p>
</td>
      <td width="10px">&nbsp;</td>
      <td width="705px">
         <div class="header">
             <div class="header-links-top">
                 <a href="http://java.sun.com">java.sun.com</a> |
                 <a href="http://docs.sun.com/">docs.sun.com</a><br>
             </div> 
             <img src="graphics/tutorialBanner.gif" width="704" height="120" alt="The Java&trade; EE 5 Tutorial"/>
             <div class="header-links">
	         <a href="index.html">Home</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/information/download.html">Download</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/doc/JavaEETutorial.pdf">PDF</a> |
                 <a href="http://java.sun.com/javaee/5/docs/api/index.html">API</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/information/faq.html">FAQ</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/information/search.html">Search</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/information/sendusmail.html">Feedback</a> |
                 <a href="http://java.sun.com/javaee/5/docs/tutorial/information/history.html">History</a>
             </div>
             <div class="navigation">
                 <a href="bnafu.html"><img style="padding-right: 3px" src="graphics/leftButton.gif" border="0"></a>
                 <a href="sjsaseej2eet.html"><img style="padding-right: 3px" src="graphics/upButton.gif" border="0"></a>
                 <a href="bnagb.html"><img style="padding-left: 3px" src="graphics/rightButton.gif" border="0"></a>
             </div>
         </div>

	 <div class="maincontent">      	 
             

<a name="bnafv"></a><h3>Writing Service Methods</h3>
<p><a name="indexterm-231"></a><a name="indexterm-232"></a><a name="indexterm-233"></a>The service provided by a servlet is implemented in the <tt>service</tt> method of a
<tt>GenericServlet</tt>, in the <tt>do<i>Method</i></tt> methods (where <i>Method</i> can take the value <tt>Get</tt>, <tt>Delete</tt>,
<tt>Options</tt>, <tt>Post</tt>, <tt>Put</tt>, or <tt>Trace</tt>) of an <tt>HttpServlet</tt> object, or in any other
protocol-specific methods defined by a class that implements the <tt>Servlet</tt> interface. In the
rest of this chapter, the term <b>service method</b> is used for any method in
a servlet class that provides a service to a client.</p><p>The general pattern for a service method is to extract information from the
request, access external resources, and then populate the response based on that information.</p><p><a name="indexterm-234"></a>For HTTP servlets, the correct procedure for populating the response is to first
retrieve an output stream from the response, then fill in the response headers,
and finally write any body content to the output stream. Response headers must
always be set before the response has been committed. Any attempt to set
or add headers after the response has been committed will be ignored by
the web container. The next two sections describe how to get information from
requests and generate responses.</p>

<a name="bnafw"></a><h4>Getting Information from Requests</h4>
<p><a name="indexterm-235"></a><a name="indexterm-236"></a><a name="indexterm-237"></a><a name="indexterm-238"></a>A request contains data passed between a client and the servlet. All requests
implement the <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html">ServletRequest</a> interface. This interface defines methods for accessing the following information:</p>
<ul><li><p>Parameters, which are typically used to convey information between clients and servlets</p></li>
<li><p>Object-valued attributes, which are typically used to pass information between the servlet container and a servlet or between collaborating servlets</p></li>
<li><p>Information about the protocol used to communicate the request and about the client and server involved in the request</p></li>
<li><p>Information relevant to localization</p></li></ul>
<p><a name="indexterm-239"></a>For example, in <tt>CatalogServlet</tt> the identifier of the book that a customer wishes
to purchase is included as a parameter to the request. The following code
fragment illustrates how to use the <tt>getParameter</tt> method to extract the identifier:</p><pre>String bookId = request.getParameter("Add");
if (bookId != null) {
    Book book = bookDB.getBook(bookId);</pre><p><a name="indexterm-240"></a><a name="indexterm-241"></a><a name="indexterm-242"></a><a name="indexterm-243"></a>You can also retrieve an input stream from the request and manually parse
the data. To read character data, use the <a href="http://java.sun.com/javase/6/docs/api/java/io/BufferedReader.html">BufferedReader</a> object returned by the
request&rsquo;s <tt>getReader</tt> method. To read binary data, use the <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletInputStream.html">ServletInputStream</a> returned by
<tt>getInputStream</tt>.</p><p><a name="indexterm-244"></a><a name="indexterm-245"></a><a name="indexterm-246"></a>HTTP servlets are passed an HTTP request object, <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletRequest.html">HttpServletRequest</a>, which contains the request
URL, HTTP headers, query string, and so on.</p><p><a name="indexterm-247"></a>An HTTP request URL contains the following parts:</p><pre>http://[<i>host</i>]:[<i>port</i>][<i>request-path</i>]?[<i>query-string</i>]</pre><p><a name="indexterm-248"></a>The request path is further composed of the following elements:</p>
<ul><li><p><b>Context path</b>: A concatenation of a forward slash (<tt>/</tt>) with the context root of the servlet&rsquo;s web application.</p></li>
<li><p><b>Servlet path</b>: The path section that corresponds to the component alias that activated this request. This path starts with a forward slash (<tt>/</tt>).</p></li>
<li><p><b>Path info</b>: The part of the request path that is not part of the context path or the servlet path.</p></li></ul>
<p>If the context path is <tt>/catalog</tt> and for the aliases listed in <a href="#bnafx">Table&nbsp;4-4</a>,
<a href="#bnafy">Table&nbsp;4-5</a> gives some examples of how the URL will be parsed.</p><a name="bnafx"></a><h6>Table&nbsp;4-4 Aliases</h6><table><col width="50%"><col width="50%"><tr><th align="left" valign="top" scope="column"><p>Pattern</p></th>
<th align="left" valign="top" scope="column"><p>Servlet</p></th>
</tr>
<tr><td align="left" valign="top" scope="row"><p><tt>/lawn/*</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>LawnServlet</tt></p></td>
</tr>
<tr><td align="left" valign="top" scope="row"><p><tt>/*.jsp</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>JSPServlet</tt></p></td>
</tr>
</table><a name="bnafy"></a><h6>Table&nbsp;4-5 Request Path Elements</h6><table><col width="45%"><col width="32%"><col width="21%"><tr><th align="left" valign="top" scope="column"><p>Request Path</p></th>
<th align="left" valign="top" scope="column"><p>Servlet Path</p></th>
<th align="left" valign="top" scope="column"><p>Path
Info</p></th>
</tr>
<tr><td align="left" valign="top" scope="row"><p><tt>/catalog/lawn/index.html</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>/lawn</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>/index.html</tt></p></td>
</tr>
<tr><td align="left" valign="top" scope="row"><p><tt>/catalog/help/feedback.jsp</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>/help/feedback.jsp</tt></p></td>
<td align="left" valign="top" scope="row"><p><tt>null</tt></p></td>
</tr>
</table><p><a name="indexterm-249"></a>Query strings are composed of a set of parameters and values. Individual parameters
are retrieved from a request by using the <tt>getParameter</tt> method. There are
two ways to generate query strings:</p>
<ul><li><p>A query string can explicitly appear in a web page. For example, an HTML page generated by <tt>CatalogServlet</tt> could contain the link <tt>&lt;a href="/bookstore1/catalog?Add=101">Add To Cart&lt;/a></tt>. <tt>CatalogServlet</tt> extracts the parameter named <tt>Add</tt> as follows:</p><pre>String bookId = request.getParameter("Add");</pre></li>
<li><p>A query string is appended to a URL when a form with a <tt>GET</tt> HTTP method is submitted. In the Duke&rsquo;s Bookstore application, <tt>CashierServlet</tt> generates a form, then a user name input to the form is appended to the URL that maps to <tt>ReceiptServlet</tt>, and finally <tt>ReceiptServlet</tt> extracts the user name using the <tt>getParameter</tt> method.</p></li></ul>


<a name="bnafz"></a><h4>Constructing Responses</h4>
<p><a name="indexterm-250"></a><a name="indexterm-251"></a><a name="indexterm-252"></a>A response contains data passed between a server and the client. All responses
implement the <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletResponse.html">ServletResponse</a> interface. This interface defines methods that allow you to:</p>
<ul><li><p><a name="indexterm-253"></a><a name="indexterm-254"></a><a name="indexterm-255"></a><a name="indexterm-256"></a>Retrieve an output stream to use to send data to the client. To send character data, use the <a href="http://java.sun.com/javase/6/docs/api/java/io/PrintWriter.html">PrintWriter</a> returned by the response&rsquo;s <tt>getWriter</tt> method. To send binary data in a MIME body response, use the <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletOutputStream.html">ServletOutputStream</a> returned by <tt>getOutputStream</tt>. To mix binary and text data (as in a multipart response), use a <tt>ServletOutputStream</tt> and manage the character sections manually.</p></li>
<li><p>Indicate the content type (for example, <tt>text/html</tt>) being returned by the response with the <tt>setContentType(String)</tt> method. This method must be called before the response is committed. A registry of content type names is kept by the Internet Assigned Numbers Authority (IANA) at <a href="http://www.iana.org/assignments/media-types/">http://www.iana.org/assignments/media-types/</a>.</p></li>
<li><p><a name="indexterm-257"></a>Indicate whether to buffer output with the <tt>setBufferSize(int)</tt> method. By default, any content written to the output stream is immediately sent to the client. Buffering allows content to be written before anything is actually sent back to the client, thus providing the servlet with more time to set appropriate status codes and headers or forward to another web resource. The method must be called before any content is written or before the response is committed.</p></li>
<li><p>Set localization information such as locale and character encoding. See <a href="bnaxu.html">Chapter&nbsp;15, Internationalizing and Localizing Web Applications</a> for details.</p></li></ul>
<p><a name="indexterm-258"></a><a name="indexterm-259"></a><a name="indexterm-260"></a>HTTP response objects, <a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpServletResponse.html">HttpServletResponse</a>, have fields representing HTTP headers such as the following:</p>
<ul><li><p>Status codes, which are used to indicate the reason a request is not satisfied or that a request has been redirected.</p></li>
<li><p>Cookies, which are used to store application-specific information at the client. Sometimes cookies are used to maintain an identifier for tracking a user&rsquo;s session (see <a href="bnagm.html#bnagr">Session Tracking</a>).</p></li></ul>
<p>In Duke&rsquo;s Bookstore, <tt>BookDetailsServlet</tt> generates an HTML page that displays information about a
book that the servlet retrieves from a database. The servlet first sets response
headers: the content type of the response and the buffer size. The servlet
buffers the page content because the database access can generate an exception that
would cause forwarding to an error page. By buffering the response, the servlet
prevents the client from seeing a concatenation of part of a Duke&rsquo;s Bookstore
page with the error page should an error occur. The <tt>doGet</tt> method then retrieves
a <tt>PrintWriter</tt> from the response.</p><p>To fill in the response, the servlet first dispatches the request to
<tt>BannerServlet</tt>, which generates a common banner for all the servlets in the application.
This process is discussed in <a href="bnagi.html#bnagj">Including Other Resources in the Response</a>. Then the servlet retrieves the book identifier
from a request parameter and uses the identifier to retrieve information about the
book from the bookstore database. Finally, the servlet generates HTML markup that describes
the book information and then commits the response to the client by calling
the <tt>close</tt> method on the <tt>PrintWriter</tt>.</p><pre>public class BookDetailsServlet extends HttpServlet {
     ...
     public void doGet (HttpServletRequest request,
            HttpServletResponse response)
            throws ServletException, IOException {
        ...
        // set headers before accessing the Writer
        response.setContentType("text/html");
        response.setBufferSize(8192);
        PrintWriter out = response.getWriter();

        // then write the response
        out.println("&lt;html>" +
            "&lt;head>&lt;title>+
            messages.getString("TitleBookDescription")
            +&lt;/title>&lt;/head>");

        // Get the dispatcher; it gets the banner to the user
        RequestDispatcher dispatcher =
            getServletContext().
            getRequestDispatcher("/banner");
        if (dispatcher != null)
            dispatcher.include(request, response);

        // Get the identifier of the book to display
        String bookId = request.getParameter("bookId");
        if (bookId != null) {
            // and the information about the book
            try {
                Book bd =
                    bookDB.getBook(bookId);
                ...
                // Print the information obtained
                out.println("&lt;h2>" + bd.getTitle() + "&lt;/h2>" +
                ...
            } catch (BookNotFoundException ex) {
                response.resetBuffer();
                throw new ServletException(ex);
            }
        }
        out.println("&lt;/body>&lt;/html>");
        out.close();
    }
}</pre><p><tt>BookDetailsServlet</tt> generates a page that looks like <a href="#bnaga">Figure&nbsp;4-2</a>.</p><a name="bnaga"></a><h6>Figure&nbsp;4-2 Book Details</h6><img src="figures/web-bookDetails.gif" alt="Screen capture of book details. Shows "Web Servers for Fun and Profit" author, review, and price, with links "Add to Cart" and "Continue Shopping."" width="662" height="657"></img>
         </div>
         <div class="navigation">
             <a href="bnafu.html"><img style="padding-right: 3px" src="graphics/leftButton.gif" border="0"></a>
             <a href="sjsaseej2eet.html"><img style="padding-right: 3px" src="graphics/upButton.gif" border="0"></a>
             <a href="bnagb.html"><img style="padding-left: 3px" src="graphics/rightButton.gif" border="0"></a>
         </div>

         <div class="copyright">
      	    <p>The material in The Java&trade; EE 5 Tutorial is <a href='docinfo.html'>copyright</a>-protected and may not be published in other works without express written permission from Sun Microsystems.</p>
      	 </div>

      </td>
   </tr>
</tbody>
</table>
</body>
</html>

